Browser
Creates new browser that allows querying remote Chrome instance for debugging sessions
Samples
import pl.wendigo.chrome.Browser
import pl.wendigo.chrome.api.network.EnableRequest
import pl.wendigo.chrome.api.page.NavigateRequest
import pl.wendigo.chrome.sync
fun main() {
//sampleStart
val browser = Browser
.builder()
.withAddress("127.0.0.1:9222")
.runInDocker(true)
.multiplexConnections(true)
.build()
browser.target("about:blank").use { target ->
sync(target.Page.enable())
sync(target.DOM.enable())
sync(target.CSS.enable())
sync(target.Network.enable(EnableRequest()))
browser.events().subscribe {
println("Received browser event $it")
}
target.events().subscribe {
println("Received target event $it")
}
sync(
target.Page.navigate(NavigateRequest(url = "https://github.com/wendigo/chrome-reactive-kotlin")).flatMap { (frameId) ->
target.Page.frameStoppedLoading().filter { (loadedFrameId) ->
loadedFrameId == frameId
}.take(1).singleOrError()
}
)
println("Created target is ${target.targetId()} with session info ${target.session()}")
browser.targets().forEach {
println("Target ${it.targetId} has url: ${it.url} and browser context id: ${it.browserContextId}")
}
Thread.sleep(100000)
}
browser.close()
//sampleEnd
}
Types
Functions
attach
Link copied to clipboard
browserInfo
Link copied to clipboard
protocolVersion
Link copied to clipboard
target
Link copied to clipboard
targets
Link copied to clipboard
Properties
Accessibility
Link copied to clipboard
Lazily returns AccessibilityDomain domain object allowing to invoke methods on Accessibility protocol domain.
Animation
Link copied to clipboard
Lazily returns AnimationDomain domain object allowing to invoke methods on Animation protocol domain.
ApplicationCache
Link copied to clipboard
Lazily returns ApplicationCacheDomain domain object allowing to invoke methods on ApplicationCache protocol domain.
Audits
Link copied to clipboard
BackgroundService
Link copied to clipboard
Browser
Link copied to clipboard
CacheStorage
Link copied to clipboard
Lazily returns CacheStorageDomain domain object allowing to invoke methods on CacheStorage protocol domain.
Cast
Link copied to clipboard
Console
Link copied to clipboard
Database
Link copied to clipboard
Debugger
Link copied to clipboard
DeviceOrientation
Link copied to clipboard
Lazily returns DeviceOrientationDomain domain object allowing to invoke methods on DeviceOrientation protocol domain.
DOMDebugger
Link copied to clipboard
DOMSnapshot
Link copied to clipboard
DOMStorage
Link copied to clipboard
Emulation
Link copied to clipboard
Fetch
Link copied to clipboard
HeadlessExperimental
Link copied to clipboard
HeapProfiler
Link copied to clipboard
Lazily returns HeapProfilerDomain domain object allowing to invoke methods on HeapProfiler protocol domain.
IndexedDB
Link copied to clipboard
Lazily returns IndexedDBDomain domain object allowing to invoke methods on IndexedDB protocol domain.
Input
Link copied to clipboard
Inspector
Link copied to clipboard
Lazily returns InspectorDomain domain object allowing to invoke methods on Inspector protocol domain.
LayerTree
Link copied to clipboard
Lazily returns LayerTreeDomain domain object allowing to invoke methods on LayerTree protocol domain.
Media
Link copied to clipboard
Memory
Link copied to clipboard
Network
Link copied to clipboard
Overlay
Link copied to clipboard
Page
Link copied to clipboard
Performance
Link copied to clipboard
Lazily returns PerformanceDomain domain object allowing to invoke methods on Performance protocol domain.
PerformanceTimeline
Link copied to clipboard
Profiler
Link copied to clipboard
Runtime
Link copied to clipboard
Schema
Link copied to clipboard
Security
Link copied to clipboard
ServiceWorker
Link copied to clipboard
Lazily returns ServiceWorkerDomain domain object allowing to invoke methods on ServiceWorker protocol domain.
Storage
Link copied to clipboard
SystemInfo
Link copied to clipboard
Target
Link copied to clipboard
Tethering
Link copied to clipboard
Tracing
Link copied to clipboard
WebAudio
Link copied to clipboard
WebAuthn
Link copied to clipboard
Sources
jvm source
Link copied to clipboard